Business
Jobs
  • About Us
  • Solutions
    • Job Postings
      Post your job and receive qualified candidates in 48h.
    • Candidate Assessments
      500+ technical and psychological tests, plus anti-fraud.
    • Headhunting
      Tailor-made executive search from start to finish.
    • Payroll + EOR
      Payroll dispersal and EOR across 15+ LATAM countries.
  • Pricing
  • Jobs

0

177
Views
How can I ssh into "Web App On Linux" docker container on Azure?

How can I ssh into the container with the new "Web App On Linux" service?

It is currently in preview mode, I'm not sure that it is not possible yet or I have overseen the settings.

about 4 years ago · Santiago Trujillo
3 answers
Answer question

0

Here is an example that I got working with ssh together with a asp.net core app in linux container:

Dockerfile

#base image
FROM mcr.microsoft.com/dotnet/core/aspnet:3.0-buster-slim AS base

#ssh
ENV SSH_PASSWD "root:Docker!"
RUN apt-get update \
        && apt-get install -y --no-install-recommends dialog \
        && apt-get update \
  && apt-get install -y --no-install-recommends openssh-server \
  && echo "$SSH_PASSWD" | chpasswd 

COPY MyApp/sshd_config /etc/ssh/
COPY MyApp/init.sh /usr/local/bin/

WORKDIR /app
EXPOSE 80 443 2222

FROM mcr.microsoft.com/dotnet/core/sdk:3.0-buster AS build
WORKDIR /src
COPY ["MyApp/MyApp.csproj", "MyApp/"]
RUN dotnet restore "MyApp/MyApp.csproj"
COPY . .
WORKDIR "/src/MyApp"
RUN dotnet build "MyApp.csproj" -c Release -o /app/build

FROM build AS publish
RUN dotnet publish "MyApp.csproj" -c Release -o /app/publish

FROM base AS final
WORKDIR /app
COPY --from=publish /app/publish .
    
ENTRYPOINT ["bash","init.sh"]

init.sh in root folder of .net core project

service ssh start
dotnet MyApp.dll

sshd_config in root folder of .net core project

#
# /etc/ssh/sshd_config
#

Port            2222
ListenAddress       0.0.0.0
LoginGraceTime      180
X11Forwarding       yes
Ciphers                 aes128-cbc,3des-cbc,aes256-cbc
MACs                    hmac-sha1,hmac-sha1-96
StrictModes         yes
SyslogFacility      DAEMON
PrintMotd       no
IgnoreRhosts        no
#deprecated option 
#RhostsAuthentication   no
RhostsRSAAuthentication yes
RSAAuthentication   no 
PasswordAuthentication  yes
PermitEmptyPasswords    no
PermitRootLogin     yes

enter image description here

about 4 years ago · Santiago Trujillo Report

0

For now, It is not possible. Please refer to this feedback.

Update on 2017-6-8

Now, it is possible, please refer to SSH support for Azure Web App on Linux.

about 4 years ago · Santiago Trujillo Report

0

As of today (4/1/2019) it is possible according to this doc: Connect to Web App for Containers using. It's kind of hacking but it does the trick.

Not an April fool's joke.

about 4 years ago · Santiago Trujillo Report
Answer question
Find remote jobs

Discover the new way to find a job!

Top jobs
Top job categories
Business
Post vacancy Pricing Sales
Legal
Terms and conditions Privacy policy
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Show me some job opportunities
There's an error!